/*
 * Copyright (c) $today.year-Now http://www.zxpnet.com All rights reserved.
 */

package com.zxp.springboot.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.CommandLineRunner;
import org.springframework.core.annotation.Order;
import org.springframework.stereotype.Component;

/**
 * 启动时只执行一次
 * @desc:
 * @author: shollin
 * @date: 2021/6/19/019 22:46
 */
@Component
@Order(2)
@Slf4j
public class MyCommandLineRunner implements CommandLineRunner {

    @Value("${server.port:8080}")
    private Integer port;

    @Value("${spring.profiles.active:'dev'}")
    private String profile;

    @Value("${server.servlet.context-path:'/'}")
    private String contextPath;

    @Override
    public void run(String... args) throws Exception {
      log.info("MyCommandLineRunner run "+args);

    }
}
